-- Table: public."AppointmentCheckPoints"

-- DROP TABLE public."AppointmentCheckPoints";

CREATE SEQUENCE "AppointmentCheckPoints_AppointmentCheckPointsId_seq";
CREATE TABLE public."AppointmentCheckPoints"
(
    "AppointmentCheckPointsId" integer NOT NULL DEFAULT nextval('"AppointmentCheckPoints_AppointmentCheckPointsId_seq"'::regclass),
	"AppointmentId" integer NOT NULL,
    "Action" text COLLATE pg_catalog."default" NOT NULL,
    "Date" timestamp(6) with time zone NOT NULL default now(),
	"AccountId" integer not null,
	"RoleId" integer not null,
    CONSTRAINT "AppointmentCheckPoints_pkey" PRIMARY KEY ("AppointmentCheckPointsId"),
	CONSTRAINT "AppointmentCheckPoints_AppointmentId_fkey" FOREIGN KEY ("AppointmentId")
        REFERENCES public."Appointment" ("AppointmentId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
CONSTRAINT "AppointmentCheckPoints_AccountId_fkey" FOREIGN KEY ("AccountId")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
CONSTRAINT "AppointmentCheckPoints_RoleId_fkey" FOREIGN KEY ("RoleId")
        REFERENCES public."Role" ("RoleId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION		
)

TABLESPACE pg_default;

ALTER TABLE public."AppointmentCheckPoints"
    OWNER to postgres;